package net.zbus.rpc;

import net.zbus.ClientPool;
import net.zbus.ClientPoolConfig;

public class SMSClient {

	public static void main2(String[] args) throws Exception {
		ClientPoolConfig config = new ClientPoolConfig();
		config.setHost("10.60.60.13");//zbus服务器地址
		config.setPort(15555);//zbus服务端口
		
		ClientPool pool = new ClientPool(config);
		 
		String phones = "18675597978"; //测试手机号码
		String funCode = "01"; //功能码，默认送01
		String systemCode = "011";//系统码，默认送01
		Rpc rpc = new Rpc(pool, "SMS_SERVICE");
		String msg = "短信发送测试" ;//测试短信内容
		String msgType ="15";//短信类别
		/**
		 * rpc调用方式发送短信，返回值成功为0，失败为-1
		 */
		Object o = rpc.invoke("sendCustomMsg",phones, msg, funCode, systemCode,msgType);
		System.out.println(o);
		
		pool.destroy(); 

	}
	
	public static void main(String[] args) throws Exception {
		ClientPoolConfig config = new ClientPoolConfig();
		config.setHost("10.60.60.13");//zbus服务器地址
		config.setPort(15555);//zbus服务端口
		
		ClientPool pool = new ClientPool(config);
		 
		String phones = "18675597978"; //测试手机号码
		String funCode = "2"; //功能码，默认送01
		String systemCode = "1";//系统码，默认送01
		Rpc rpc = new Rpc(pool, "SMS_SERVICE");
		String msg = "短信发送测试" ;//测试短信内容 
		/*
		 * rpc调用方式发送短信，返回值成功为0，失败为-1
		 */
		Object o = rpc.invoke("sendMsg",phones, msg, funCode, systemCode);
		System.out.println(o);
		
		pool.destroy(); 

	}
}
